Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Merged
2 tasks
ShaneK
added a commit
to ionic-team/ionic-framework
that referenced
this pull request
Jun 1, 2026
Issue number: resolves #30982, resolves #30686, resolves #30730 --------- ## What is the current behavior? Core's package.json has no `exports` field. Webpack and Vite handle that fine, but Node's strict ESM resolver ignores nested package.json files and refuses directory imports. So when the built `@ionic/angular` bundle does `import { defineCustomElements } from '@ionic/core/loader'` or `import { componentOnReady } from '@ionic/core/components'`, anything running under Node ESM (Angular 21's default Vitest builder, raw Node, etc.) throws `ERR_UNSUPPORTED_DIR_IMPORT`. All three resolved issues have the same root problem ## What is the new behavior? Core's package.json now declares an `exports` map that covers every directory in `files` with explicit `index.js` resolution where directory imports happen, and wildcards for the deep paths ## Does this introduce a breaking change? - [x] Yes - [ ] No When you add `exports` to a package.json, it becomes an allowlist. This means that every undocumented import path will break unless you're using `moduleResolution: node` Related docs PR: ionic-team/ionic-docs#4523 ## Other information Apps already on `moduleResolution: "bundler"` (Angular 17+ default, Vite default) pick up the fix automatically. Apps on classic `moduleResolution: "node"` keep working through the legacy fields and are unaffected. Current dev build: ``` 8.8.9-dev.11780086312.13aac420 ```
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds a "Package Exports" subsection to the Ionic 9 upgrade guide, related to this PR: ionic-team/ionic-framework#31180